/*****************************************************************************
  Copyright ?2002-2004 by Martin Cook. All rights are reserved. If you like
  this code then feel free to go ahead and use it. The only thing I ask is 
  that you don't remove or alter my copyright notice. Your use of this 
  software is entirely at your own risk. I make no claims about the 
  reliability or fitness of this code for any particular purpose. If you 
  make changes or additions to this code then please clearly mark your code 
  as yours. If you have questions or comments then please contact me at: 
  martin@codegator.com
  
  Have Fun! :o)
*****************************************************************************/

using System;
using System.Configuration;

using CG.Security.Data.Configuration;

namespace CG.Security.Configuration
{
	/// <summary>
	/// Manages the reading of all configuration settings for the library.
	/// </summary>
	public sealed class SettingsManager
	{

		// ******************************************************************
		// Attributes.
		// ******************************************************************

		private static CG.Security.Data.Configuration.DataSettings c_dataSettings;

		// ******************************************************************
		// Properties.
		// ******************************************************************

		#region Properties

		/// <summary>
		/// Reads the application configuration settings that are specific to
		/// the CG.Security.Data namespace.
		/// </summary>
		public static CG.Security.Data.Configuration.DataSettings DataSettings		
		{
			
			get 
			{
				
				// Should we read from the application configuration file?
				if (c_dataSettings == null)
					c_dataSettings = (DataSettings)ConfigurationSettings.GetConfig(
					 "CG.Security.Data/runtimeSetup"
					);

				return c_dataSettings;

			} // End get

		} // End DataSettings

		#endregion

	} // End class SettingsManager

} // End namespace CG.Security.Configuration

